#include "gaschnigCalc.h"

gaschnigCalc::gaschnigCalc(void)
{
}

gaschnigCalc::~gaschnigCalc(void)
{
}

const int	gaschnigCalc::calcScore(const int* now, const int* end, int size)
{
	int *tmp;
	int i, b, a, rez;

	_size = size * size;
	tmp = new int[_size];
	memcpy(tmp, now, _size * sizeof(int));
	for (rez = i = 0; i < _size; i++)
	{
		if (tmp[i] != end[i])
		{
			rez++;
			for(b = i; b < _size && now[b] != end[i]; b++)
				;
			a = tmp[i];
			tmp[i] = tmp[b];
			tmp[b] = a;
		}
	}
	return rez;
}

const int	gaschnigCalc::calcdist(const int num, const int pos, const int *final, int size)
{
	return 0;
}
